package router

import (
	"sixboss/api"

	"github.com/gin-gonic/gin"
)

func InitRouter() {
	r := gin.Default()

	r.GET("/", func(ctx *gin.Context) {
		ctx.JSON(200, gin.H{"message": "hello 111SixBoss"})
	})

	router := r.Group("api")
	{
		router.GET("user/:id", api.GetUserInfo)
		router.GET("users", api.GetUsers)
		router.POST("user/add", api.AddUser)

		router.GET("login", api.Login)
	}

	r.Run()
}
